struct Solution {}

fn main() {}

impl Solution {
    pub fn is_palindrome(s: String) -> bool {
        let legal_chars = "abcdefghijklmnopqrstuvwxyz1234567890";
        let mut sc = s.clone();
        sc = sc.to_lowercase();
        let sc_filter = sc.chars().filter(|&c| legal_chars.contains(c)).collect::<String>();
        let sc_filter_rev = sc_filter.chars().rev().collect::<String>();
        sc_filter == sc_filter_rev
    }
}